import request from '../utils/request'

// 上传课程封面接口

export const upImgApi=(data:any)=>{
  return request({
    url:"/VueHandler/UpLoadPicHandler",
    method:"post",
    headers:{
      "Content-Type":"multipart/form-data"
    },
    data
  })
}

// 添加课程信息接口
export const addCourseApi=(data:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=add",
    method:"post",
    data
  })
}
// 课程信息请求接口
export const getCourse=(ID:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=getcourse",
    method:"get",
    params:{
      ID
    }
  })
}

// 添加目录接口
export const addDirApi=(data:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=AddDirectory",
    method:"post",
    data
  })
}
// 编辑目录接口
export const editDirApi=(data:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=updateDirectory",
    method:"post",
    data
  })
}
// 删除目录接口
export const delDirApi=(params:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=deleteDirectory",
    method:"get",
    params
  })
}
// 获取课程下的目录列表接口
export const getCourseDir=(CDid:any)=>{
  return request({
    url:"/VueHandler/VideoHandler?action=finddir",
    method:"get",
    params:{
      CDid
    }
  })
}

// 添加课件  给目录添加视频接口
export const addDirVideoApi=(params:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=addvideo",
    method:"get",
    params
  })
}

// 获取目录下的视频列表接口
export const getDirVideoList=(params:any)=>{
  return request({
    url:"/VueHandler/VideoHandler?action=showdir",
    method:"get",
    params
  })
}

// 删除课件  删除目录下的视频接口
export const delDirVideoApi=(params:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=delvideo",
    method:"get",
    params
  })
}


// 获取课程列表数据接口
export const getCourseListApi=(data:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=show",
    method:"post",
    data
  })
}

// 整体保存课程接口
export const saveAllcourse=(data:any)=>{
  return request({
    url:"/VueHandler/CourseHandler?action=update",
    method:"post",
    data
  })
}